package com.cplatform.movie.back.utils;

import org.apache.commons.lang.StringUtils;


/**
 * 正则工具类.
 * <p>
 * Copyright: Copyright (c) 2015年5月14日 下午5:13:51
 * <p>
 * Company: 北京宽连十方数字技术有限公司
 * <p>
 * Author: zuoty@c-platform.com
 * <p>
 * Version: 1.0
 * <p>
 */
public class RegUtils {

	private final  static String onlyNumAndcCharacterAndAlphabetMatches = "^[a-zA-Z0-9\u4e00-\u9fa5]+$";
	
	private final static String checkOpenTimeRegx = "^(([0-1]\\d)|(2[0-4])):[0-5]\\d-(([0-1]\\d)|(2[0-4])):[0-5]\\d$";
	
	public static boolean onlyNumAndcCharacterAndAlphabet(String str){
		return str.matches(onlyNumAndcCharacterAndAlphabetMatches);
	}
	
	public static boolean checkOpenTime(String str){
		return (!StringUtils.isNotBlank(str))?true:str.matches(checkOpenTimeRegx);
	}
}
